/*
 * Copyright By ZATI
 * Copyright By 3a3c88295d37870dfd3b25056092d1a9209824b256c341f2cdc296437f671617
 * All rights reserved.
 *
 * If you are not the intended user, you are hereby notified that any use, disclosure, copying, printing, forwarding or
 * dissemination of this property is strictly prohibited. If you have got this file in error, delete it from your system.
 */

package cn.wzc.crystal.iam.entity;

import cn.wzc.crystal.platform.support.AbstractEntity;
import lombok.Getter;
import lombok.Setter;
import org.springframework.data.relational.core.mapping.Table;

@Getter
@Setter
@Table
public class IamPerm extends AbstractEntity {

	private String permCode;
	private String permName;
	private String permType;

	// =============================   domain 逻辑 ===================================

	// 权限类型 1菜单 2 按钮 3 资源 4 权限
	public static final String PERM_TYPE_MENU = "1";
	public static final String PERM_TYPE_BUTTON = "2";
	public static final String PERM_TYPE_RESOURCE = "3";
	public static final String PERM_TYPE_AUTHORITY = "4";

	/**
	 * 是否是一个菜单
	 *
	 * @return true 表示是菜单
	 */
	public boolean isMenu() {
		return PERM_TYPE_MENU.equals(this.permType);
	}

	/**
	 * 是否是一个按钮
	 *
	 * @return true 表示是按钮
	 */
	public boolean isButton() {
		return PERM_TYPE_BUTTON.equals(this.permType);
	}

	/**
	 * 是否是一个资源
	 *
	 * @return true 表示是资源
	 */
	public boolean isResource() {
		return PERM_TYPE_RESOURCE.equals(this.permType);
	}

	/**
	 * 是否是一个权限
	 *
	 * @return true 表示是权限
	 */
	public boolean isAuthority() {
		return PERM_TYPE_AUTHORITY.equals(this.permType);
	}


}
